﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataAccess;
namespace SQT.tracnghiem.Ajax.ASP
{
    public partial class sign_in : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string username = Request.QueryString["username"];
            var get_user = new TblUserController().FetchAll().Where(x => x.UserName.ToLower() == username.ToLower()).Single();
            Session["user"] = username;
            Session["user_id"] = get_user.UserId;
            Session["level"] = get_user.UserLevel;
            HttpCookie ck = new HttpCookie("user");
            ck.Value = get_user.UserId.ToString();
            Response.Cookies.Add(ck);
        }
    }
}